<html>


<script src="https://cdn.bootcss.com/jsencrypt/3.0.0-beta.1/jsencrypt.js"></script>
<script src="base64.js"></script>

<script>

    var PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCYIu2WSJrO/wduWZlyTYOqinTIx0VwyQh76QblQ+r23kg7tifgp+1e6AF18RZ/YdNtpTpc1eH/32TrI/oLbE4nQ/jYphB6DrDab7kzJB6596fkuMjhXxuFWUpVn+KjM8Z95t/RSeIEcmmT4FcPan/Ocdj/PlFqIeO3+niC1/Pg0QIDAQAB";

    var encrypt = new JSEncrypt();
    encrypt.setPublicKey('-----BEGIN PUBLIC KEY-----' + PUBLIC_KEY + '-----END PUBLIC KEY-----');

    var data = "{\"pwd\":\"CHENzhuo199432*\",\"account\":\"CHEN123456\"}";
    var encrypted = encrypt.encrypt(data);

    // var encodeBasr64data = encode64(encrypted);

    console.log('加密后数据:%o', encrypted);

</script>

</html>


